//
// Copyright (c) 2009 All Right Reserved
//
// vl
//
// 2009-01-01
// Contains ...
using System.Globalization;
using System.Text;
using JetBrains.Annotations;
namespace LargoCommon.Music
{
///
/// Musical Band.
///
public sealed class HarmonicBand {
#region Constructors
///
/// Initializes a new instance of the HarmonicBand class.
///
/// Band number.
/// Band value.
public HarmonicBand(int bandNumber, float bandValue) {
this.Number = bandNumber;
this.Value = bandValue;
}
///
/// Initializes a new instance of the class.
///
[UsedImplicitly]
public HarmonicBand() {
}
#endregion
#region Properties
///
/// Gets value.
///
/// Property description.
public int Number { get; }
///
/// Gets or sets a value indicating whether.
///
/// Property description.
public bool Modal { get; set; }
///
/// Gets or sets value.
///
/// Property description.
public float Value { get; set; }
///
/// Gets or sets the consonance bonus - measured to main sounding tone.
///
/// Property description.
public float SonanceBonus { get; set; }
#endregion
#region String representation
/// String representation of the object.
/// Returns value.
[UsedImplicitly]
public override string ToString() {
var s = new StringBuilder();
s.Append(
string.Format(
CultureInfo.InvariantCulture,
"{0}{1}\t",
string.Format(CultureInfo.CurrentCulture.NumberFormat, "Band {0,6}: ", this.Number),
string.Format(CultureInfo.CurrentCulture.NumberFormat, "{0,6:F1} ", this.Value)));
s.Append(this.Modal ? "modal" : "-");
s.Append(string.Format(CultureInfo.CurrentCulture.NumberFormat, " Sonance {0,6:F1} ", this.SonanceBonus));
//// s.Append(this.StringOfProperties());
return s.ToString();
}
#endregion
}
}